import { ref, computed } from 'vue'
import { defineStore } from 'pinia'

//定义数据模块
export const useUserInfoStore = defineStore('userinfo', () => {
  
  //定义需要管理的数据
  const userinfo = ref({})

  //保存用户信息
  function save_userinfo(u:any) {
    userinfo.value = u;
  }

  //删除用户信息
  function remove_userinfo(){
    userinfo.value = {}
  }

  return { userinfo,save_userinfo,remove_userinfo }
}, {persist:true})
